<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" type="text/css" href="./css/style.min.css">
    <title>我的订单</title>
</head>
<script type="text/javascript">
    window.onload=function () {
            document.addEventListener('touchstart',function (event) {
                if(event.touches.length>1){
                    event.preventDefault();
                }
            })
            var lastTouchEnd=0;
            document.addEventListener('touchend',function (event) {
                var now=(new Date()).getTime();
                if(now-lastTouchEnd<=300){
                    event.preventDefault();
                }
                lastTouchEnd=now;
            },false)
        }
</script>

<body>
    <div id="personal_center">
        <div class="t-container t-padding-none">
            <header class="cl" v-show="header.show">
                <div class="nav-bar cl">
                    <span class="goback arrow_l" @click="goback"></span>
                    <span class="page-name" v-cloak>{{shop_name}}会员店</span>
                </div>
            </header>
            <div class="t-main">
                <div class="t-order-tab">
                    <div class="t-order-tab-ul">
                        <div class="tab-slide" v-for="(item,$index) in tabs">
                            <a href="javascript:void(0);" @click="choose($index,item.status);" :class="{'t-order-tab-ul-li':$index===selected}">
                                <span class="tabs-span" v-cloak>{{item.tabName}}<i class="t-corner" v-show="item.leng > 0">{{item.leng}}</i></span>
                            </a>
                        </div>
                    </div>
                </div>
                <div class="t-whole-main" v-show="contentShow">
                    <div class="t-whole-goods-item" v-for="(item,$index) in list">
                        <div class="t-whole-header" v-cloak>
                            <!-- <p class="header-icons">{{item.orderType == 10 ? '自营' : '第三方'}}</p> -->
                            <p v-if="selected != 4">{{'订单号:' + item.orderSn}}</p>
                            <p v-else>{{'退款单号:' + item.orderSn}}</p>
                            <span v-if="selected != 4 && item.status == -10">已取消</span>
                            <span v-if="selected != 4 && item.status == 0">待确认</span>
                            <!-- <span v-if="selected != 4 && item.orderType == 30">即采</span>
                            <span v-if="selected != 4 && item.orderType == 40">自建</span> -->
                            <span v-if="selected != 4 && item.status == 10">待付款</span>
                            <span v-if="selected != 4 && item.status == 20">待发货</span>
                            <span v-if="selected != 4 && item.status == 30">待收货</span>
                            <span v-if="selected != 4 && item.status == 31">已收货</span>
                            <span v-if="selected != 4 && item.status == 40">已完成</span>
                            <span v-if="selected == 4 && item.status == -10">退款失败</span>
                            <span v-if="selected == 4 && item.status == 0">退款关闭</span>
                            <span v-if="selected == 4 && item.status == 10">待审核</span>
                            <span v-if="selected == 4 && item.status == 20">待买家退款</span>
                            <span v-if="selected == 4 && item.status == 30">待卖家退款</span>
                            <span v-if="selected == 4 && item.status == 40 && item.payStatus == 3">退货退款成功</span>
                            <span v-if="selected == 4 && item.status == 40 && (item.payStatus == 0 || item.payStatus == 2)">退款失败</span>
                            <span v-if="selected == 4 && item.status == 40 && (item.payStatus != 0 && item.payStatus != 2 && item.payStatus != 3)">退款中</span>
                            <span v-if="selected == 4 && item.status == 50">卖家拒绝退款</span>
                            <span v-if="selected == 4 && item.status == 60">待平台介入</span>
                        </div>
                        <div class="order-mun">
                            <p v-cloak>{{(selected != 4 ? '订单时间:' : '退款时间:') + item.ctime}}</p>
                        </div>
                        <a @click="gotoDetail(item)" v-for="gitem in item.goods">
                            <div class="t-whole-content">
                                <div class="t-whole-pic">
                                    <img :src="gitem.imgUrlSmall" alt="">
                                </div>
                                <div class="t-box-flex">
                                    <strong v-cloak>{{gitem.goodsName}}</strong>
                                    <p>
                                        <span v-cloak>{{gitem.skuAttr}}</span>
                                    </p>
                                </div>
                                <div class="t-box-right">
                                    <span v-cloak>￥{{gitem&&gitem.price&&gitem.price.toFixed(2)}}</span>
                                    <p v-cloak>x{{gitem.qty}}</p>
                                </div>
                            </div>
                        </a>
                        <div class="t-whole-footer" v-cloak>
                            <p>
                                <!-- 优惠券后价格 -->
                                <span>共</span>
                                <span>{{item.totalQty}}</span>
                                <span>件</span>
                                <span>合计：</span>
                                <span>￥{{item&&item.totalAmount&&item.totalAmount.toFixed(2)}}</span>
                                <span v-if="item.totalDiscount > 0" style="display: block">优惠金额:￥{{item&&item.totalDiscount&&item.totalDiscount.toFixed(2)}}</span>
                                 <!-- 优惠券前价格 -->
                                 <!-- <span>共</span>
                                <span>{{item.totalQty}}</span>
                                <span>件</span>
                                <span>合计：</span>

                                <span>￥{{item.totalGoodsAmount.toFixed(2)}}</span> -->
                            </p>
                            
                            <!-- v-if="item.refundAllowed && selected != 4 || item.operationAllowed && selected != 4 && item.status == 30 || !item.operationAllowed && selected != 4" -->
                            
                            <!-- 付款弹层  -->
                            <div class="btn-group isShowFooterModel"  v-if="selected != 4 && item.status == 10" v-show="isShowFooterModel[$index]"  >
                                <a href="javascript:void(0)" class="t-btn lineDownPay" v-if="selected != 4 && item.status == 10 && item.sellerShopType == 2" @click="lineDownPay(item)">线下支付</a>
                                <a href="javascript:void(0)" class="active" v-if="selected != 4 && item.status == 10" @click="pay(item)">立即付款</a>
                                <a href="javascript:void(0)" class=" posPay" v-if="selected != 4 && item.status == 10" @click.prevent="hidefn(item)" :class="{hide:pShow}">pos机支付</a>
                            </div>
                            
                            <div class="btn-group" v-if="item.payType == 1 && item.offlinePayStatus == 10">
                                <span class="offlineSpan">如已线下付款，请通知卖家进行确认</span>
                                <a href="javascript:void(0)" class="t-btn lineDownPay" >已线下支付</a>
                            </div>

                            <div class="btn-group"  v-else>
                                <a href="javascript:void(0)" v-if=" selected != 4 && item.status == 10" @click="order_cancel(item.orderSn)">取消订单</a>
                               <a href="javascript:void(0)" class="t-btn payBtnGroup" v-if="selected != 4 && item.status == 10" @click="payBtnGroup($index)">付款</a>
                                <a :href="'return-goods-details.html?storeid=' + store_id + '&oid=' + item.id" v-if="item.isRefund >= 0">查看退款</a>
                                <!-- 优惠后价格 -->
                                <a :href="'return-goods.html?storeid='+store_id+'&status='+item.status+'&total='+item.totalAmount+'&id='+item.id" v-if="false||item.refundAllowed && selected != 4">退货退款</a>
                               <!--  <a :href="'return-goods.html?storeid='+store_id+'&status='+item.status+'&total='+item.totalGoodsAmount+'&id='+item.id" v-if="item.refundAllowed && selected != 4">退货退款</a> -->
                                <a href="javascript:void(0)" class="active" v-if="item.operationAllowed && selected != 4 && item.status == 30" @click="order_confirm(item.id)">确认收货</a>

                                <a href="javascript:void(0)" @click="cancel(item.refundId)" v-if="selected == 4 && (item.status == 10 || item.status == 20 || item.status == 30)">撤销</a>
                                <a href="javascript:void(0)" class="active" @click="modify(item.refundId,item.orderId)" v-if="selected == 4 && item.status == 10 && item.auditStep == 0">修改</a>
                                <a href="javascript:void(0)" class="active" @click="writelog(item)" v-if="selected == 4 && item.status == 20">填写物流</a>
                                <a href="javascript:void(0)" class="active" @click="readlog(item)" v-if="selected == 4 && item.status == 30">查看物流</a>
                            </div>
                        </div>
                        <div class="t-gap-box"></div>
                    </div>

                </div>
                <!-- pos二维码 -->
                <div class="pos-modul popup" v-cloak :class="{hide:pop_hide}">
                    <div class="pos-img">
                        <img v-bind:src="imgUrl" alt="">
                    </div>
                    <div class="layer" @click="closeLayer"></div>
                </div>
                <!-- 店铺公众号 -->
                <div class="pos-modul popup" v-cloak :class="{hide:pop_code_hide}">
                    <div class="pos-code-img">
                        <!-- <img v-bind:src="imgUrl" alt=""> -->
                        <a href="javascript:void(0)" @click="closeWechatLayer" class="code-close"></a>
                        <div class="pop-code-content">
                            <p class="pcc-title">关注微信公众号，把微信和店铺打通</p>
                            <div class="code-img-group">
                                <div  :class="[isWechatImg  ? wechatCodeImgBox : CodeImgBox]">
                                    <img v-bind:src="WechatCodeImg" alt="">
                                    <p>公众号ID：{{WechatCodeID}}</p>
                                </div>
                                <div class="weixin-code-img"  v-show="isWechatImg">
                                    <img src="images/code-push.png" alt="">
                                    <p>长按二维码识别并关注</p>
                                </div>
                            </div>                           
                        </div>
                        <div class="pop-code-footer">
                            <div class="pop-code-footer-c">
                                <p>关注后即可在微信公众号查询自己的订单</p>
                                <p>更时时、更方便哟~</p>
                            </div>
                            
                        </div>
                    </div>
                    <div class="layer" @click="closeWechatLayer">
                        
                    </div>
                </div>
                <p class="loading-tip" v-cloak>{{loading_tip}}</p>
            </div>
        </div>
        <confirm ref="confirm"></confirm>
        <toast ref="toast" style="z-index: 20001;"></toast>
        <alerts ref="alerts"></alerts>
    </div>
    <script type="text/x-template" id="tpl-confirm-content">
        <div class="refund-submit-form">
            <p>
                <label>物流公司：</label>
                <input type="text" name="" value="" id="log_company">
            </p>
            <p>
                <label>物流单号：</label>
                <input type="text" name="" value="" id="log_sn">
            </p>
            <p>
                <label>联系电话：</label>
                <input type="text" name="" value="" id="log_tel">
            </p>
            <span>为确保您的货物顺利送达，物流信息真实有效，请保持您的联系电话畅通</span>
        </div>
    </script>
    <script type="text/x-template" id="tpl-alert-content">
        <div class="logistics-info">
            <p>物流公司:<span id="log_company_show"></span></p>
            <p>物流单号:<span id="log_sn_show"></span></p>
        </div>
    </script>
    <script src="./js/lib/vue.js"></script>
    <script src="http://static.jdhui.com/lib/vue-resource/1.2/vue-resource.js"></script>
    <script src="http://js.jdhui.com/common/WebViewJsBridge.js"></script>
    <script src="./js/min/config.min.js"></script>
    <script src="./js/min/common.min.js"></script>
    <script src="./js/min/component.min.js"></script>

    <script>
        var toast = component.popup.toast(),
            confirm = component.popup.confirm({
                name: 'confirm',
                type: 'confirm'
            }),
            alerts = component.popup.confirm({
                name: 'alert',
                type: 'alert'
            });
        var app = new Vue({
            el: '#personal_center',
            data: function() {
                return {
                    header: {
                        show: !APP.iswechat()
                    },
                    isWechatImg:APP.iswechat(),
                    wechatCodeImgBox:'wechat-code-img-box',
                    CodeImgBox:'code-img-box',
                    list: [],
                    status: APP.getQueryString('status') || '',

                    isloading: false,
                    page: 0,
                    loading_tip: '数据加载中',
                    store_id: APP.getQueryString('storeid'),
                    posShow: APP.getQueryString('posShow'),
                    html: '',

                    tabs: [{
                        tabName: '全部',
                        status: '',
                        leng: 0
                    }, {
                        tabName: '待付款',
                        status: 10,
                        leng: 0
                    }, {
                        tabName: '待发货',
                        status: 20,
                        leng: 0
                    }, {
                        tabName: '待收货',
                        status: 30,
                        leng: 0
                    }, {
                        tabName: '退货退款',
                        status: 999,
                        leng: 0
                    }],
                    selected: APP.getQueryString('status') == 10 ? 1 : (APP.getQueryString('status') == '20' ? 2 : (APP.getQueryString('status') == '30' ? 3 : (APP.getQueryString('status') == '999' ? 4 : 0))),
                    keyword: '',
                    startTime: '',
                    endTime: '',
                    shop_name: '',
                    member_id: '',
                    pop_hide: true,
                    pop_code_hide:true,
                    WechatCodeImg:'',
                    WechatCodeID:'',
                    imgUrl:'',
                    pShow:false,
                    contentShow:true,
                    isShowFooterModel:[],
                    payType:'',
                    offlinePayStatus:'',
                    sellerShopType:''
                }
            },
            mounted: function() {
                APP.init(this, function() {
                    this.shop_name = APP.getCookie('shopname');
                    this.member_id = APP.getCookie('memberid');
                }.bind(this), function(arg) {
                    this.shop_name = arg.body.data.shop.shop_name;
                    this.member_id = arg.body.data.member.member_id;
                }.bind(this));
                this.getData();
                //this.isPosShow();
                window.addEventListener('scroll', this.scrollLoading);
            },
            destroyed: function() {
                window.removeEventListener('scroll', this.scrollLoading);
            },
            components: {
                'toast': toast,
                'confirm': confirm,
                'alerts': alerts
            },
            methods: {
                hidefn:function(item){
                    
                     if(this.posShow == 1){
                        WebViewJsBridge.invoke("pos-pay", {orderId: item.orderSn}, function() {
                            window.location.href = _url;
                        });
                    }else{
                        this.pop_hide = false;
                        this.imgUrl = APIJAVA + 'qrcode?text=' + item.orderSn
                        setInterval(function(){
                            console.log(count);
                            Vue.http.post(APIJAVALINEPAY + '/c/mobile/order/checkStatusChange',{
                                shopId: this.store_id,
                                orderSn: item.orderSn,
                                currentStatus:item.status
                            },{
                                 emulateJSON: true
                            }).then(function(_res){
                                console.log(_res.body.code==1);
                                if(_res.body.code == 1){
                                    window.location.reload();
                                    // if(count == 5){
                                    //     clearInterval(a);
                                    // }                                   
                                }
                            }.bind(this))
                        }.bind(this),1000)
                    }                    
                },
                closeLayer:function(){
                    this.pop_hide = true;
                },
                closeWechatLayer:function(){
                    // var host = window.location.host;
                    // var _url = "http://" + host + '/order-details.html?storeid=' + this.store_id + '&orderSn=' + item.orderSn;
                    this.pop_code_hide = true;
                    window.location.reload();
                    //window.location.href = _url;
                },
                goback: function() {
                    window.location.href = 'personal-center.html?storeid=' + this.store_id;
                },
                getData: function() {
                    this.page++;
                    this.isloading = true;
                    if (this.selected != 4) {
                        Vue.http.post(APIJAVA + 'c/mobile/order/list', {
                            pageIndex: this.page,
                            keyword: this.keyword,
                            startTime: this.startTime,
                            endTime: this.endTime,
                            status: this.status,
                            shopId: this.store_id
                        }, {
                            emulateJSON: true
                        }).then(function(_res) {
                            this.isloading = false;
                            var _data = _res.body;
                            if (_data.code == 1) {
                                this.list = this.list.concat(_data.obj.results);
                                this.contentShow=true;
                                for(var i = 0;i < _data.obj.results.length;i++){
                                    this.isShowFooterModel.push(false);
                                }
                                if (_data.obj.pageIndex >= _data.obj.totalPage) {
                                    this.loading_tip = '没有更多数据';
                                    window.removeEventListener('scroll', this.scrollLoading);
                                } else {
                                    this.loading_tip = '加载更多数据';
                                }
                            }else{
                                this.$refs.toast.show(_data.message);
                            }
                        }.bind(this), function(err) {
                            this.isloading = false;
                        }.bind(this));

                        //获取店铺二维码
                        Vue.http.jsonp('http://jdhui2.jdhtest.jdhui.com/pcapi/member-shop/getmembershopinfo?shop_id=' + this.store_id
                        ).then(function(_res) {                        
                            if (_res.body.error_code == 0) {
                                var _re = _res.body.data;
                                console.log(_re);
                                this.WechatCodeImg = _re.signal_img;
                                this.WechatCodeID = _re.openid;
                            }
                        }.bind(this))

                    } else {
                        Vue.http.post(APIJAVA + 'c/mobie/refund/list', {
                            keyword: this.keyword,
                            startDate: this.startTime,
                            endDate: this.endTime,
                            shopId: this.store_id,
                            page: this.page,
                            size: 10
                        }, {
                            emulateJSON: true
                        }).then(function(_res) {
                        	this.isloading = false;
                            var _re = _res.body;
                            var _list = [];
                                   if (_re.page&&_re.page.list&&_re.page.list.length>0) {
                                    _re.page.list.forEach(function(v, k) {
                                    var item = {
                                        shopName: '',
                                        status: v.status,
                                        orderSn: v.orderRefundSn,
                                        orderId: v.order.id,
                                        ctime: v.ctime,
                                        totalQty: v.order.totalQty,
                                        totalGoodsAmount: v.order.totalGoodsAmount,
                                        goods: _re.orders[k].goods,
                                        refundId: v.id,
                                        auditStep: v.auditStep,
                                        logisticsCompany: v.logisticsCompany,
                                        logisticsSn: v.logisticsSn,
                                        logisticsPhone: v.logisticsPhone,
                                        payStatus: v.payStatus
                                    };
                                    _list.push(item);
                                    }.bind(this));
                                } 
                            this.list = this.list.concat(_list);
                            if (_re.page&&_re.page.list&&_re.page.list.length < 10||!_re) {
                                this.loading_tip = '没有更多数据';
                                window.removeEventListener('scroll', this.scrollLoading);
                            } else if(_re.page&&_re.page.list&&_re.page.list.length >= 10) {
                                this.loading_tip = '加载更多数据';
                            }
                        }.bind(this));
                    }
                    Vue.http.get(APIJAVA + 'c/mobile/order/order-status-count?shopId=' + this.store_id , {}).then(function(_res) {
                        if (_res.body.code == 1) {
                            var re = _res.body.obj;
                            if (re["10"] && parseInt(re["10"]) > 0) {
                                this.tabs[1].leng = re["10"];
                            }
                            if (re["20"] && parseInt(re["20"]) > 0) {
                                this.tabs[2].leng = re["20"];
                            }
                            if (re["30"] && parseInt(re["30"]) > 0) {
                                this.tabs[3].leng = re["30"];
                            }
                            if (re["-100"] && parseInt(re["-100"]) > 0) {
                                this.tabs[4].leng = re["-100"];
                            }
                            
                        }
                    }.bind(this));
                    /*Vue.http.post(APIJAVA + 'c/mobie/refund/list', {
                        keyword: '',
                        startDate: '',
                        endDate: '',
                        shopId: this.store_id,
                        page: this.page,
                        size: 10
                    }, {
                        emulateJSON: true
                    }).then(function(_res) {
                        console.log(_res);
                        var _re = _res.body;
                        console.log(_re);
                    }.bind(this));*/
                },
                formatTime: function(nows) {
                    var now = new Date(nows);
                    var year = now.getFullYear();
                    var month = now.getMonth() + 1;
                    var date = now.getDate();
                    var hour = now.getHours();
                    var minute = now.getMinutes();
                    var second = now.getSeconds();
                    return year + "-" + (month < 10 ? ('0' + month) : month) + "-" + (date < 10 ? ('0' + date) : date) + " " + (hour < 10 ? ('0' + hour) : hour) + ":" + (minute < 10 ? ('0' + minute) : minute) + ":" + (second < 10 ? ('0' + second) : second);
                },
                scrollLoading: function() {
                    if (this.isloading) return;
                    if (document.body.scrollHeight - document.body.scrollTop - window.innerHeight < 150) {
                        this.getData();
                    }
                },
                order_cancel: function(sn) {
                    this.$refs.confirm.show({
                        content: '<p class="stext-center">确定取消订单？</p>',
                        confirm: function() {
                            Vue.http.get(APIJAVA + 'c/mobile/order/cancel?shopId=' + this.store_id + '&orderSn=' + sn).then(function(_res) {
                                if (_res.body.code == 1) {
                                    this.$refs.toast.show('取消订单成功');
                                    setTimeout(function() {
                                        window.location.reload();
                                    }, 2000);
                                } else {
                                    this.$refs.toast.show('取消订单失败');
                                }
                            }.bind(this))

                        }.bind(this)
                    });
                },
                order_confirm: function(id) {
                    this.$refs.confirm.show({
                        content: '<p class="stext-center">确定收货？</p>',
                        confirm: function() {
                            Vue.http.get(APIJAVA + 'c/mobile/order/receive?shopId=' + this.store_id + '&id=' + id).then(function(_res) {
                                if (_res.body.code == 1) {
                                    this.$refs.toast.show('确认收货成功');
                                    setTimeout(function() {
                                        window.location.reload();
                                    }, 2000);
                                } else {
                                    this.$refs.toast.show('确认收货失败');
                                }
                            }.bind(this))

                        }.bind(this)
                    });
                },
                choose: function(index, s) {
                    this.contentShow=false;
                    this.selected = index;
                    window.location.href = "my-order.html?storeid=" + this.store_id + '&status=' + s;
                },
                gotoDetail: function(item) {
                    if (this.selected != 4) {
                        window.location.href = 'order-details.html?storeid=' + this.store_id + '&orderSn=' + item.orderSn;
                    } else {
                        window.location.href = 'return-goods-details.html?storeid=' + this.store_id + '&oid=' + item.orderId + '&rid=' + item.refundId;
                    }
                },
                cancel: function(rid) {
                    this.$refs.confirm.show({
                        type: 'confirm',
                        title: '提示',
                        content: '是否撤销退款',
                        cancelText: '取消',
                        confirmText: '确定',
                        confirm: function() {
                            Vue.http.get(APIJAVA + 'c/mobie/refund/cancel?shopId=' + this.store_id + '&id=' + rid, {}, {
                                emulateJSON: true
                            }).then(function(_res) {
                                if (_res.body.code == 1) {
                                    this.$refs.toast.show('撤销成功');
                                    setTimeout(function() {
                                        window.location.reload();
                                    }, 2000);
                                } else {
                                    this.$refs.toast.show('撤销失败');
                                }
                            });
                        }.bind(this)
                    });
                },
                writelog: function(item) {
                    this.$refs.confirm.show({
                        type: 'confirm',
                        title: '退货给卖家',
                        content: document.getElementById('tpl-confirm-content').innerHTML,
                        cancelText: '返回',
                        confirmText: '确认退货',
                        confirm: function() {
                            var log_company = document.getElementById('log_company'),
                                log_sn = document.getElementById('log_sn'),
                                log_tel = document.getElementById('log_tel');
                            if (log_company.value == '') {
                                this.$refs.toast.show('请填写物流公司名称');
                                return true;
                            }
                            if (log_sn.value == '') {
                                this.$refs.toast.show('请填写物流单号');
                                return true;
                            }
                            if (log_tel.value == '') {
                                this.$refs.toast.show('请填写联系电话');
                                return true;
                            }
                            Vue.http.post(APIJAVA + 'c/mobie/refund/updateLogistics', {
                                id: item.refundId,
                                logisticsCompany: log_company.value,
                                logisticsSn: log_sn.value,
                                logisticsPhone: log_tel.value,
                                shopId: this.store_id
                            }, {
                                emulateJSON: true
                            }).then(function(_res) {
                                if (_res.body.code == 1) {
                                    window.location.reload();
                                } else {
                                    this.$refs.toast.show('退货失败');
                                }
                            }.bind(this));
                        }.bind(this)
                    });
                },
                readlog: function(item) {
                    this.$refs.alerts.show({
                        title: '查看物流信息',
                        content: document.getElementById('tpl-alert-content').innerHTML,
                        confirmText: '关闭'
                    });
                    setTimeout(function() {
                        document.getElementById('log_company_show').innerHTML = item.logisticsCompany;
                        document.getElementById('log_sn_show').innerHTML = item.logisticsSn;
                    }.bind(this));
                },
                modify: function(rid) {
                    window.location.href = "return-goods.html?isedit=1&storeid=" + this.store_id + "&rid=" + rid + '&id=' + this.oid;
                },
                pay: function(item) {
                    var host = window.location.host;
                    var _url = "http://" + host + '/order-details.html?storeid=' + this.store_id + '&orderSn=' + item.orderSn;
                        //pc端支付                        
                        Vue.http.post(APIJAVA + 'c/mobile/order/pay', {
                            shopId: this.store_id,
                            orderSn: item.orderSn,
                            returnUrl: _url
                        }, {
                            emulateJSON: true
                        }).then(function(_res) {
                            console.log(_res);                       
                            if(_res.body.code == 1){
                                console.log(_res.body.obj);
                                this.html = _res.body.obj;
                                window.location.href = this.html;
                            }else{
                                this.$refs.toast.show(_res.body.message);
                            }
                            
                            // setTimeout(function() {
                            //     document.getElementById('alipaysubmit').submit();
                            //     //$('#alipaysubmit').submit();
                            // }, 1000)
                        }.bind(this), function(_res) {
                            console.log(_res);
                        })                   
                },
                payBtnGroup:function(index){
                    this.$set(this.isShowFooterModel, index, !this.isShowFooterModel[index]); 
                },
                lineDownPay:function(item){
                    
                    //线下支付检查
                    Vue.http.get(APIJAVALINEPAY + 'c/mobile/order/payOfflineCheck?shopId=' + this.store_id + '&orderSn=' + item.orderSn).then(function(_res) {
                            console.log(_res);
                            if (_res.body.code == 1) {
                                
                                //线下支付
                                Vue.http.get(APIJAVALINEPAY + 'c/mobile/order/payOffline?shopId=' + this.store_id + '&orderSn=' + item.orderSn).then(function(_res){

                                    if(_res.body.code == 1){
                                        this.$refs.toast.show(_res.body.message);
                                        setTimeout(function() {
                                            if(this.WechatCodeImg == null || this.WechatCodeImg == ""){
                                                window.location.reload();
                                            }else{
                                                this.pop_code_hide = false;                                               
                                            }
                                        }.bind(this), 2000);
                                    }else{
                                        this.$refs.toast.show(_res.body.message);
                                    }
                                }.bind(this))

                            } else {
                                this.$refs.toast.show(_res.body.message);
                            }
                    }.bind(this)) 
                }
                // isPosShow:function(){
                //     if(this.posShow == 1){
                //         this.pShow = true;
                //     } 
                // }
            }
        })
    </script>
</body>

</html>